﻿<div class="header">
  <div class="header_inner">
    <h1 class="logo">
      <a title="{config.webname}" href="{config.weburl}">{config.webname}</a>
    </h1>
    <ul class="nav">
      <li><a href="<%linkurl("index")%>">首页</a></li>
      <li><a href="<%linkurl("news")%>">新闻资讯</a></li>
      <li><a href="<%linkurl("goods")%>">购物商城</a></li>
      <li><a href="<%linkurl("photo")%>">图片分享</a></li>
      <li><a href="<%linkurl("down")%>">资源下载</a></li>
    </ul>
    <div class="search">
      <input id="keywords" name="keywords" class="input" type="text" x-webkit-speech="" autofocus="" placeholder="输入回车搜索" onkeydown="if(event.keyCode==13){SiteSearch('<%linkurl("search")%>', '#keywords');return false};" />
      <input class="submit" type="submit" value="搜索" onclick="SiteSearch('<%linkurl("search")%>', '#keywords');" />
    </div>
    <script type="text/javascript">
        $.ajax({
            type: "POST",
            url: "{config.webpath}tools/submit_ajax.ashx?action=user_check_login",
            dataType: "json",
            timeout: 20000,
            success: function (data, textStatus) {
                if (data.status == 1) {
                    $("#menu").append('<li><a href="<%linkurl("usercenter","exit")%>">退出</a></li>');
                    $("#menu").append('<li><a href="<%linkurl("usercenter","index")%>">会员中心</a></li>');
                } else {
                    $("#menu").append('<li><a href="<%linkurl("register")%>">注册</a></li>');
                    $("#menu").append('<li><a href="<%linkurl("login")%>">登录</a></li>');
                }
            }
        });
    </script>
    <ul id="menu" class="menu">
      <li><a href="<%linkurl("content","contact")%>">联系我们</a></li>
      <li><a href="<%linkurl("shopping","cart")%>">购物车<script type="text/javascript" src="{config.webpath}tools/submit_ajax.ashx?action=view_cart_count"></script>件</a></li>
    </ul>
  </div>
</div>